#include <bits/stdc++.h>
using namespace std;

int maxArea(vector<int>& height) {
    int l = height.size();
    int i = 0, j = l-1, res = 0;
    while(i < j) {
        res = height[i] < height[j] ? 
        max(res, (j-i)*height[i++]):
        max(res, (j-i)*height[j--]);
    }
    return res;
}